import java.util.HashSet;
import java.util.Set;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 26727
 * Date: 2024-08-31
 * Time: 17:16
 */
class Solution3 {
    public boolean containsDuplicate(int[] nums) {
        Set<Integer> hash = new HashSet<>();

        for(int x : nums) {
            if(hash.contains(x)) {
                return true;
            }
            hash.add(x);
        }
        return false;
    }
}
